const Mock = require('mockjs')

// var data = Mock.mock({'username|2-5':'#'})

// var data = Mock.mock({'age|2-5':0})


module.exports = function(uniapp){
    if(process.env.MOCK == 'true')
    uniapp.use('/api/userinfo',(req,res)=>{
        var data = Mock.mock({
            id:"@id()",
            username:"@cname()",
            date:"@date()",
            description:"@paragraph()",
            email:"@email()",
            'age|18-30':0,
            shengf:[{
                id:1,value:'江西'
            },
            {
                id:2,value:'江西66'
            }]
        })
        res.json(data)
    })
}